﻿using Dynamic.Api.TestService.Model;
using Dynamic.Utils;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace Dynamic.Api.TestService
{

    /// <summary>
    /// 获取管理员
    /// </summary>
    [Service("MyServer")]
    public class DynamicApiTestService : IDynamicWebApi
    {

        /// <summary>
        /// 动态API服务
        /// </summary>
        /// <returns></returns>
        [HttpGet("list")]
        [AllowAnonymous]
        public async Task<List<Employee>> GetAll()
        {
            List<Employee> employees = new List<Employee>
            {
                new Employee("1001", "刘大"),
                new Employee("1002", "刘二")
            };
            return await Task.FromResult(employees);
        }

    }
}
